package net.lwf.hibernate.dao;

import net.lwf.exception.ExceptionUtil;

import org.hibernate.HibernateException;
import org.hibernate.Transaction;


public class BaseDAO {
	
	public void rollback(Transaction tx) {
		if (tx != null && tx.isActive()) {
			try {
				tx.rollback();
			}
		    catch(HibernateException hex) {
		    	ExceptionUtil.logAndThrowException(BaseDAO.class, hex);
		    }
		}
	}

}
